#define MAX		1000000
#define MAX2	1000000
#include<fstream>
#include<iostream>
using namespace std;
#include "stdlib.h"
#include "time.h"
int result=-1;
int MyRand(int seed);
int main()
{
	fstream file1("d:\\query.txt");
	file1<<MAX<<endl;
	int x,y,temp=0;
	//int z,w;

	srand( (unsigned)time( NULL ) ); 


	for(int i=1;i<=MAX;i++)
	{
		
		if(temp!=i*100/MAX)
		{
		temp=i*100/MAX;
		system("cls");
		cout<<"Building d:\\query.txt...";
		cout<<temp;
		cout<<"%...";
		}

	x=rand();
	y=rand();
	//z=rand();
	//w=rand();

	//file1<<"range";
	file1<<"nearest";
	//file1<<' '<<x<<' '<<y<<' '<<z<<' '<<w<<endl;
	file1<<' '<<x<<' '<<y<<endl;
	}
	file1.close();

	temp=0;


	fstream file2("d:\\points.txt");
	file2<<MAX2<<endl;

	srand( (unsigned)time( NULL ) ); 


	for(int i=1;i<=MAX2;i++)
	{
		if(temp!=i*100/MAX2)
		{
		temp=i*100/MAX2;
		system("cls");
		cout<<"Building d:\\points.txt...";
		cout<<temp;
		cout<<"%...";
		}

	x=rand();
	y=rand();

	file2<<x<<' '<<y<<endl;
	}
	file2.close();



}
